package com.fireline.beauty.image;

import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.wb.swt.SWTResourceManager;

public class ImageUtil {
	public static Image shears(Image img, int width, int height) {
		ImageData data = img.getImageData().scaledTo(width, height);
		Image newimge = new Image(img.getDevice(), data);
		return newimge;
	}

	public static Image getImage(String name, int width, int height) {
		Image img = SWTResourceManager.getImage(ImageUtil.class, name);
		return shears(img, width, height);
	}

	public static Image getImage(String name) {
		return SWTResourceManager.getImage(ImageUtil.class, name);
	}
}
